<script type="text/javascript">
    //导入cookie
    var VueCookie = require('vue-cookie');

    //接口地址
    const serverAddr = 'https://mops-dev.lianluo.com:883/api/v2';

    //获取并设置token
    const authorization = VueCookie.get('authorization');

    //时间格式化函数
    function timeTrans(targetDate) {
        var date = new Date(targetDate * 1000); //如果date为10位不需要乘1000
        var Y = date.getFullYear() + '-';
        var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
        var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
        return Y + M + D;
    }

    export default
    {
        serverAddr,
        authorization,
        timeTrans
    }
</script>
